<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title">项目交底资料信息</h4>
</div>
<div class="modal-body">
    <form role="form" class="validator_form" action="{:url('/Index/Project/Contract/add')}" id="addProjectContractForm" method="post">
        <input type="hidden" name="project_id" value="{:$base_project_id}">
        <div class="box-body">
            <input type="hidden" name="file_id" id="file_id">
            <div class="form-group">
                <label>上传文件</label>
                <br/>
                <button type="button" class="btn label-primary   webuploader-file" id="project_file">上传文件</button>
            </div>
            <div class="form-group">
                <div>
                    <ul id="project_filelist_file">

                    </ul>
                </div>
            </div>
            <div class="form-group">
                <label>类型</label>
                <select name="mtype" class="form-control" required>
                                <option value="">请选择</option>
                                    {volist name="file_type" id="file"}
                                    <option value="{$file.m_value}">{$file.m_name}</option>
                                    {/volist}
                            </select>

            </div>

            <div class="form-group">
                <label>资料类型</label>
                <select name="mtypea" class="form-control" required>
                                    <option value="">请选择</option>
                                        {volist name="contract_typea" id="file"}
                                        <option value="{$file.m_value}">{$file.m_name}</option>
                                        {/volist}
                                </select>

            </div>


        </div>
        <div class="box-footer">
            <button type="submit" class="btn btn-primary">确认</button>
        </div>



    </form>
</div>



<script>
    $(function() {
        ajax_form_submit("addProjectContractForm");

        $("#project_file").webUploadFile({
            Ul_fileList: "project_filelist_file",
            fileIDValue: "file_id",
            filePathValue: "file_name",
            fileNumLimit: 6,
            multiple: true

        }, function(file, response) { //上传完成
            if (response.status == 200) {
                //  $("#user_pic_img").attr("src", response.savename);
                reg = /,$/gi
                var new_file_ids = response.fileid + "," + $("#file_id").val()
                $("#file_id").val(new_file_ids.replace(reg, ""));


                $("#project_filelist_file").append(' <li class="file_name' + response.fileid + '">' + response.filename + ' <a href="javascript:;" class="label label-danger filedel' + response.fileid + '">删除</a></li>');
            } else {
                bootoast({
                    message: response.filename,
                    type: 'danger',
                    position: 'right-top',
                    timeout: 2
                });
            }
        });
    });
</script>